--share|1.0.0

web = web or {}

function web.SystemMessage(player,msg)
    NLG.SystemMessage(player,msg);
end

function web.GetYS(a,b)
	return a - math.floor(a/b) * b
end

function web.Get62Num(_s)
	local _num = 0
	for i=1,string.len(_s) do
		if i >1 then
			_num = _num + (Get62Chr(string.sub(_s,0-i,0-i))*62 + (62*(i-2)*10))
		else
			_num = _num + Get62Chr(string.sub(_s,0-i,0-i))
		end
	end
	return _num
end
function Get62Chr(_s)
	local _fuk = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
	for i=1,string.len(_fuk) do
		if string.sub(_fuk,i,i) == _s then
			return i-1
		end
	end
	return 0
end

function web.Num62Str(_num)
	local _convertTable = {"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0"}
	local x_t = {}
	local function co(dec)
	    local function fn(num, t)
		if(num < 62) then
		    table.insert(t, num)
		else
		    fn( math.floor(num / 62), t)
		    table.insert(t, web.GetYS(num,62))
		end
	    end
	    fn(dec, x_t)
	end
	co(_num)
	local text = ""
    for k, v in ipairs(x_t) do
        text = text.._convertTable[v+1]
    end
    return text
end

return web;


